<?php
/*
 * ajax调用文件
 * @author  Sameal
 * @package ixdcw
 * @file    index.inc.php
 * @time    12-12-12 下午2:02
 */
define('DT_NONUSER', true);
require_once DT_INC . '/post.func.php';


switch ($action) {
	case 'getusertimes':
		if ($_userid) {

			$user = $db->getOne("SELECT erniedate , erniedate2 FROM {$db->getPre()}member WHERE userid=$_userid");
			$date=timetodate($DT_TIME,3);
			$secondNo = $db->count("{$db->getPre()}ernieshare","`userid`='{$_userid}' AND `date`='{$date}'");

			$times = 0;
			if($user['erniedate']!=timetodate($DT_TIME,3)){
				$times = $times +1;
			}
			if($secondNo>=5 && $user['erniedate2']!=timetodate($DT_TIME,3)){
				$times = $times +1;
			}
			echo '{
			"times":'.$times.',
			"money":0
			}';

		} else {
			echo '{
				"times":0,
				"money":0
				}';
		}
		break;
	case 'getresult':
		require 'prize.inc.php';
		break;
}
